package com.itawei.d3_collection.demo;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 增强for循环
 */
public class CollectionDemo3 {
    public static void main(String[] args) {
        //1.创建Collection 并添加元素
        Collection<String> coll = new ArrayList<>();
        coll.add("陈平安");
        coll.add("刘亦菲");
        coll.add("刘诗诗");
        coll.add("章若楠");
        coll.add("赵敏");

        //2.使用增强for循环遍历集合
        for (String s : coll) {
            System.out.println(s);
        }
    }
}
